package DataStructuresTest;

import DataStructuresTest.ArrayListTest.MyArrayList;
import DataStructuresTest.LinkListTest.MyLinkedList;
import DataStructuresTest.Solution;

import java.util.ArrayList;

public class Question {
    public static void main(String[] args) {
        Solution solution = new Solution();
        //《数据结构考研复习指导》P18-10
//        int p = 3;int array[] = {1,2,3,4,5,6,7,8,9};
//        solution.page_18_10(p,array);

        //数组右移
//        array = solution.rightShiftArray(array,p);

        //归并排序
//        solution.mergeSort(array,0,5);
//        solution.printArray(array);

        //binarySearch
//        System.out.println(solution.binarySearch(array,5));

        //gcd
//        System.out.println(solution.gcd(3,5));

//        MyLinkedLis,d("a");

//        String str = "(())()(";
//        System.out.println(solution.isBalanceSymbol(str,'(',')'));

//        System.out.println(solution.postfixCalculator("6 5 2 3 + 8 * + 3 + *"));
//        System.out.println(solution.turnToPostfix("a - b - c"));

//        String string = "aaabhajcbfsdvbsdcjackafaj";
//        solution.test(string);

        MyLinkedList<Integer> myLinkedList = new MyLinkedList<>();
        myLinkedList.add(1);myLinkedList.add(2);myLinkedList.add(3);myLinkedList.add(4);
        myLinkedList.remove(2);

        MyArrayList<Integer> myArrayList = new MyArrayList<>();
        myArrayList.add(1);myArrayList.add(2);myArrayList.add(3);myArrayList.add(4);
        System.out.println(myArrayList);
        myArrayList.remove(2);
        System.out.println(myArrayList);

        ArrayList<Integer> arrayList = new ArrayList<>();
        arrayList.add(1);
        System.out.println(arrayList.toString());
    }
}
